﻿<%@ Page Title="" Language="C#" MasterPageFile="~/EditWidows/eYUITreeList.Master"
    AutoEventWireup="true" CodeBehind="DutyInfoManager.aspx.cs" Inherits="ZX.WebApp.EditWidows.OrganizationalManager.PropCompany" %>

<%@ Register Assembly="ZX.Web.UI.Controls" Namespace="ZX.Web.UI.Controls" TagPrefix="cc1" %>
<asp:Content ID="Content4" ContentPlaceHolderID="headerPlace" runat="server">
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/reset-fonts-grids/reset-fonts-grids.css" />
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/container/assets/skins/sam/container.css" />
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/menu/assets/skins/sam/menu.css" />
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/button/assets/skins/sam/button.css" />
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/resize/assets/skins/sam/resize.css" />
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/layout/assets/skins/sam/layout.css" />
    <link rel="stylesheet" type="text/css" href="../../Scripts/yui_2.9.0/build/datatable/assets/skins/sam/datatable.css" />
    <link rel="stylesheet" type="text/css" href="../../Scripts/yui_2.9.0/build/paginator/assets/skins/sam/paginator.css" />
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/treeview/assets/skins/sam/treeview.css" />
    <style type="text/css">
    .yui-skin-sam table {
	    width: 100%;
    }
    <% =DataTableCss %>
    </style>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/element/element-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/datasource/datasource-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/connection/connection-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/get/get-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/dragdrop/dragdrop-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/calendar/calendar-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/datatable/datatable-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/layout/layout-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/button/button-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/container/container-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/treeview/treeview-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/resize/resize-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/paginator/paginator-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/event-delegate/event-delegate-min.js"></script>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="HeaderControl" runat="server">
    <!-- 工具栏 -->
    <div id="listpage">
        <div id="toolbar" style="margin: 2px;">
            <% =BtnItems %>
            <button type="button" id="btnFull" name="btnFull">
                全屏</button>
            <button type="button" id="btnReload" name="btnReload">
                刷新</button>
            <button type="button" id="btnClose" name="btnClose">
                关闭当前页</button>
        </div>
    </div>
    <!--  用于加载自定义脚本 -->
    <script src="../../Scripts/appjs/model.<% =EntityName %>.js" type="text/javascript"
        language="javascript"></script>
    <script type="text/javascript">
        YAHOO.example.init = function () {
             function onButtonClick(p_oEvent) {
                    switch(this.get("id")){ 
                        <% =InitBtnEvents %>
                    case "btnFull": 
                        fnFull();
                        break;
                    case "btnClose":
                        window.parent.$("#tabs").tabs('close','<% =PageTitle %>');
                        break;
                    case "btnReload":
                        fnReload();
                        break;
                    default:
                        break;
                    }                        
            }
            YAHOO.util.Event.onContentReady("toolbar", function () {
                <% =BtnEvents  %>
                var btnFull = new YAHOO.widget.Button("btnFull");
                btnFull.on("click", onButtonClick);
                var btnClose = new YAHOO.widget.Button("btnClose");
                btnClose.on("click", onButtonClick);
                var btnReload = new YAHOO.widget.Button("btnReload");
                btnReload.on("click", onButtonClick);
            });      
        } ();
    </script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="leftPlaceHoder" runat="server">
    <div id="left">
        <cc1:TreeViewMenu Caption="PhraseText" Key="PhraseID" TableName="DatPhraseDetail"
            AllowCheck="false" IsCustom="1" IsCustomValue="DutyInfoType" IsCustomText="职务类型"
            ID="TreeViewMenu1" runat="server"></cc1:TreeViewMenu>
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="DataPlaceHolder" runat="server">
    <div id="data">
        <div id="json">
        </div>
    </div>
    <div id="bottom">
        <div id="pagetotal" style="float: left; height: 25px; padding: 8px; margin-top: 3px;
            width: 100px;">
        </div>
        <div id="page" style="float: left">
        </div>
    </div>
    <input type="hidden" id="DutyTypeId" />
    <input type="hidden" id="DutyTypeName" />
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="ScriptPlaceHolder" runat="server">  
    <script type="text/javascript">
    var PageTotal;
    var pageindex = 1;
    var pagesize = 25;
    var const_entityName="<%=EntityName%>",
        fkey="00000000-0000-0000-0000-000000000000",
        const_functionId   ="<% =FunctionID %>",//自定义条件
        const_Order ="<% =Order %>",           //排序  
        const_UserId = "<% = UserId %>",       //
        const_DataFields = [<% =DataFields %>],
        const_DataColums = [<% =DataColums %>],
        const_EditWindowWidth = "<% =EditWindowWidth %>px",
		const_EditWindowHeight = "<% =EditWindowHeight %>px",
        const_EditEntity = "<% =EditEntity %>", //编辑实体名
        const_CustomCondition = encodeURI("<% =DefineCondition %>"),//查询方案条件
        const_Condition="",
        const_PageTitle=encodeURI("<% =PageTitle %>"),
        initialRequestUrl = "pageindex=1&entity=" + const_entityName + "&order=" + const_Order + "&r=" + Math.random() + "&zip=94089&results=10&output=json&functionid=" + const_functionId + "&customCondition=" + decodeURI(const_CustomCondition);
        const_entityID = "<% =EntityId %>";  //实体ID名称
     (function() {
        var Dom = YAHOO.util.Dom,
            Event = YAHOO.util.Event;
        Event.onDOMReady(function() {
            var layout = new YAHOO.widget.Layout({
                minWidth: 1000,
                minHeight: 500,
                units: [
                    { position: 'left', width: 160, resize: true, body: 'left', gutter: '1px 1px', 
                        collapseSize: 50, scroll: true, maxWidth: 300 },
                    { position: 'center', minWidth: 400, minHeight: 200 }
                ]
            });
            layout.on('render', function() {
                var el = layout.getUnitByPosition('center').get('wrap');
                var layout2 = new YAHOO.widget.Layout(el, {
                    parent: layout,
                    minWidth: 400,
                    minHeight: 200,
                    units: [
                        { position: 'top', body: 'toolbar', height: 35, gutter: '1px', maxHeight: 80 },
                        { position: 'bottom',  height: 35, body: 'bottom', gutter: '1px', maxHeight: 130 },
                        { position: 'center', body: 'data', gutter: '1px', scroll: true }
                    ]
                });
                layout2.render();
            });
            layout.render();
            InitLeftData();
        });
    })();
    function InitLeftData(){
            //RefreshData();
            BindData();
		    var tree1 = new YAHOO.widget.TreeView("TreeViewMenu1");
		    tree1.setNodesProperty('propagateHighlightUp',true);
		    tree1.setNodesProperty('propagateHighlightDown',true);
		    tree1.subscribe('clickEvent',tree1.onEventToggleHighlight);
            tree1.expandAll();
		    tree1.render();
    }
    function Native(caption,key){
        if(key!="DutyInfoType"){
            const_CustomCondition = "DutyTypeId='"+key+"'";
            document.getElementById("DutyTypeId").value=key;
            document.getElementById("DutyTypeName").value=caption;
        }
        initialRequestUrl = "pageindex=1&entity=" + const_entityName + "&order=" + const_Order + "&r=" + Math.random() + "&zip=94089&results=10&output=json&functionid=" + const_functionId + "&customCondition=" + decodeURI(const_CustomCondition);
        BindData();
    }
    function LoadDataById(){
        var key = document.getElementById("DutyTypeId").value;
        if(key!=""){
            const_CustomCondition = "DutyTypeId='"+key+"'";
        }
        initialRequestUrl = "pageindex=1&entity=" + const_entityName + "&order=" + const_Order + "&r=" + Math.random() + "&zip=94089&results=10&output=json&functionid=" + const_functionId + "&customCondition=" + decodeURI(const_CustomCondition);
        BindData();
        YAHOO.example.container.dialog1.hide();
    }
    var _fn, _ids;
    var GetSelected=function(ids){
        _ids=ids
    }
    
    </script>

    <!-- 通用方法 -->
    <script src="../../Scripts/common.js" type="text/javascript"></script>
    <!-- 定义数据格式化方法 -->
    <script src="../../Scripts/yui.list.dataformat.js" type="text/javascript"></script>
    <!--  用于加载自定义脚本 -->
    <script src="../../Scripts/appjs/model.<% =EntityName %>.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../Scripts/yui.list.YUITreeList.js"></script>
    <script src="../../Scripts/yui.list.YUITreeList.Edit.list.common.js" type="text/javascript"></script>
    <script src="../../Scripts/yui.list.YUITreeList.button.event.js" type="text/javascript"></script>
</asp:Content>
